import store from 'store';
let BASE_URL = '';
let uploadImgUrl = '';
let debug = true;
if (debug) {
    BASE_URL = 'http://xmlinkai.iask.in/app/index.php?c=entry&i=2&m=crm'
    uploadImgUrl = "http://xmlinkai.iask.in/app/index.php?c=entry&i=2&m=crm&do=uploadimg"
} else {
    BASE_URL = 'http://tools.5ifenxiao.cn/app/index.php?c=entry&i=5&m=crm'
    uploadImgUrl = "http://tools.5ifenxiao.cn/app/index.php?c=entry&i=5&m=crm&do=uploadimg"
}


let createUrl = function(doName, params) {
    //猎头和管理员带上 参数 user_id
    if (store.getters.roles.indexOf("hr") > -1 || store.getters.roles.indexOf("admin") > -1) {
        return BASE_URL + "&do=" + doName + "&user_id=" + store.getters.user_id;
    }

    // console.log(BASE_URL+"&do="+doName)
    return BASE_URL + "&do=" + doName;
}
export { createUrl as urlGenerator, uploadImgUrl };